<template>
  <div class="qua">
    <van-nav-bar
        left-arrow
        @click-left="onClickLeft"
        title="二维码下载"
    />
    <van-row>
      <van-col span="2"></van-col>

      <van-col span="20">
        <img v-lazy="url" class="item-img"/>
      </van-col>

      <van-col span="2"></van-col>
    </van-row>
  </div>
</template>

<script>
import { previewQuaQRCode} from "@/api/operator";

export default {
  data() {
    return {
      machineId: this.$route.query.id,
      url: ''
    };
  },
  methods: {
    onClickLeft() {
      this.$router.go(-1)
    },
    getQRCode() {
      let params = {
        id: this.machineId
      }
      previewQuaQRCode(params).then(res => {
        if (res.data) {
          this.url = res.data
        }
      })
    }
  },
  mounted() {
    this.getQRCode()
  }
};
</script>

<style lang="less" scoped>
.qua {
  text-align: center;
  padding-bottom: 100px;

  .item-img {
    height: 300px;
    padding-top: 10px;
    width: 300px;

  }
}

</style>
